package com.woniuxy.cloud;


import com.woniuxy.cloud.form.UserForm;
import com.woniuxy.cloud.ticket52.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value="user52",contextId="user")
public interface UserAPI {
    @GetMapping("/login")
    public Result login(@RequestParam("username") String username,@RequestParam("password")String password);

    @GetMapping("/checkBalance")
    public Result checkBalance(@RequestParam("userId") int userId, @RequestParam("amount") double amount);

    @PostMapping("/register")
    public Result register(@RequestBody UserForm form,@RequestHeader("from")String from);

    @PutMapping("/user/{userId}/password")
    public Result modifyPassword(@PathVariable("userId") int userId, @RequestParam("password") String password);

    @GetMapping("/user/{userId}")
    public Result getUserInfo(@PathVariable("userId") int userId);

}
